package com.cgbl.cg.adapter

import android.view.View
import com.blankj.utilcode.util.ClickUtils
import com.blankj.utilcode.util.ClipboardUtils
import com.blankj.utilcode.util.ToastUtils
import com.cgbl.cg.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.robot.base.model.CourseInfoFileBean

class CourseProfileResourceAdapter :
    BaseQuickAdapter<CourseInfoFileBean, BaseViewHolder>(R.layout.app_item_course_resource) {


    override fun convert(holder: BaseViewHolder, item: CourseInfoFileBean) {
        holder.setText(R.id.tv_resource_link, item.filePath)
            .setText(R.id.tv_resource_name, item.cover)
        holder.getView<View>(R.id.iv_link_copy).setOnClickListener {
            ClipboardUtils.copyText(item.filePath)
            ToastUtils.showShort("复制链接成功!")
        }
    }
}